package 公司真题.瑛太莱;

import java.util.Scanner;

public class _糖的递增排列 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = 1;
        int rows = 0;
        while (n > 0) {
            rows++;
            n -= m;
            m++;
        }
        System.out.println(n < 0 ? rows - 1 : rows);
    }
}
